﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QualityJudgingApp
{
    public class RawDataEntry
    {
        //Id	Picture Quality	Audio Quality	Audio Length	Time	Length	quality
        public int UserID;
        public double pictureQuality;
        public double audioQuality;
        public double audioLength;
        public double timeSpent;
        public double answerLength;
        public int quality;

        public RawDataEntry(string inputLine, int assignedID)
        {
            string[] inputStrings = inputLine.Split('\t');
            try
            {
                UserID = int.Parse(inputStrings[0]);
                pictureQuality = double.Parse(inputStrings[1]);
                audioQuality = double.Parse(inputStrings[2]);
                audioLength = double.Parse(inputStrings[3]);
                timeSpent = double.Parse(inputStrings[4]);
                answerLength = double.Parse(inputStrings[5]);
                quality = int.Parse(inputStrings[6]);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Parsing Error: \n" + inputLine);
                System.Diagnostics.Debug.WriteLine("Stack Tracing: \n" + ex.StackTrace);
            }
            UserID = assignedID;
        }
    }
}
